package controller

import (
	"encoding/json"
	"github.com/gin-gonic/gin"
	"log"
	"server/acgnovel-go/src/entity"
	"server/acgnovel-go/src/helper"
	"server/acgnovel-go/src/utils"
)

func GetUserInfo() gin.HandlerFunc {
	return func(c *gin.Context) {
		get := helper.RedisHelperGet(utils.GetToken(c))
		var user entity.Users
		if err := json.Unmarshal([]byte(get), &user); err != nil {
			log.Println(err)
		}
		utils.ResultData(c,user)
	}
}
